package com.nj.liandi.common.utils;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.commons.lang.StringUtils;

import java.util.Map;

public class OGD<T> {

    QueryWrapper<T> wrapper = new QueryWrapper<>();

    public void ww(T t, Map<String,Object> params,String column){
        QueryWrapper<T> wrapper = new QueryWrapper<T>();
        String key = (String) params.get("key");
        if (StringUtils.isNotEmpty(key)) {
            wrapper.eq(column,key);
        }

    }

    public QueryWrapper<T> createWrapper(){
        QueryWrapper<T> wrapper = new QueryWrapper<>();
        return wrapper;
    }

    public QueryWrapper<T> eq(String column,Map<String,Object> params){
        String key = (String) params.get("key");
        if (StringUtils.isNotEmpty(key)) {
            this.wrapper=wrapper.eq(column,key);
        }
        return wrapper;
    }
}
